import Request from '@/request'

export const masterLogin = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/master/login', data)
}

export const masterEdit = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/master/edit', data)
}

export const masterGetAll = <T extends object, R>(
  data: T
): Promise<IResponse<IList<R>>> => {
  return Request.get('/master/list', data)
}

export const masterDelete = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/master/delete', data)
}

export const masterAdd = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/master/add', data)
}
